package com.joysuch.wwyt.bp.mapper;

import com.joysuch.wwyt.bp.entity.InspectExceptionAlarmMesage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zr
 * @since 2021-11-26
 */
@Repository
public interface InspectExceptionAlarmMesageMapper extends BaseMapper<InspectExceptionAlarmMesage> {

    Long getRiskPointByplanId(Long planId);

    /**
     *  根据状态查看处理的风险点ids
     * @param state
     * @return
     */
    List<Long> findRiskPointIdsByState(int state ,Long tenentId , String orgCode);

    /**
     *   根据风险点id获取最新的报警信息
     * @param 
     * @return
     */
    InspectExceptionAlarmMesage getLastAlarmMeaasgeLast(Long tenentId , String orgCode , Long pointId);

    /**
     *  批量处理巡检排查报警信息
     * @param remark
     * @param alarmReason
     * @param handleBy
     * @param handleTime
     */
    void setAllMeaageHandled(String remark, String alarmReason, Long handleBy, Date handleTime);

    List<InspectExceptionAlarmMesage> findLastInspectAlarmMessage(Long tenentId , String orgCode);

    List<InspectExceptionAlarmMesage> statsForCountInDay(Date startTime, Long tenentId, String orgCode);
    List<InspectExceptionAlarmMesage> statsForinspect(Long tenentId, String orgCode);

    void setlevelNameById(Long id, String levelName);

    List<InspectExceptionAlarmMesage> findInspectExceptionAlarmMesageByState(Integer state ,Long tenentId , String orgCode);

    Integer checkCount(Long tenentId, String orgCode);


}
